const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
		{ label: '名称', prop: 'orgName' },
		{ label: '机构负责人', prop: 'burdenUserName' },
		{ label: '所属年月', prop: 'belongDate' },
		{ label: '申请时间', prop: 'applyTime' },
		{ label: '审核人', prop: 'approvalUser' },
		{
			label: '补贴状态',
			prop: 'subsidyStatus',
			custome: 'tag',
			dicData: [{ label: '已完结', value: 3, style: { color: '#00A870', background: 'rgba(0, 168, 112, 0.1)' } }],
		},
		{ label: '归档日期', prop: 'createTime' },
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

export const api = {
	index: 'view_ofsSubsidyFiling_page',
}

export const baseConfig = {
	pageName: '归档管理',
	dictcodes: ['COMMON_FLAG', 'SUBSIDY_TYPE', 'EQUIP_STATUS'],
	rowKey: 'id',
	tipLabel: 'workflowName',
	addLabel: '新增',
	exportMqTopic: '/ning/export/',
	paramsObj: {
		code: 3003,
	},
	api,
	auth: {
		index: 'view_ofsSubsidyFiling_page',
	},
	menuBtn: [
		{
			icon: 'detail',
			label: '查看',
			type: 'primary',
			operate: 'detail',
			auth: '',
			text: true,
			show: true,
		},
	],
	dialogConfig: {
		width: '80%',
	},
	tableConfig,
	onLoadFormate: async (arr) => {
		const tableData = arr.map((item) => {
			return {
				...item,
				workflowConfiguration: item.workflowConfiguration ? JSON.parse(item.workflowConfiguration) : [],
			}
		})
		return Promise.resolve(Object.freeze(tableData))
	},
}
